#!/usr/bin/env python
# coding: utf-8

"""
packages.py
create by cuiyu 2025-03-01
说明：
 * 验证安装的包

用法:
  packages.py

更新:
2025-03-01:
"""
# rich
from rich import print
print( "[bold magenta]rich: [/bold magenta]你看见彩色文字输出, [bold magenta]说明 rich 安装正常[/bold magenta]!" , ":vampire:")



# loguru
import loguru
print(f"loguru version = {loguru.__version__}")

# 1. pytorch gpu 需要去 pytorch 官网查询对应版本的安装命令
# uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# import torch
# print(f"torch.__version__ = {torch.__version__}")
# print(f"torch gpu = {torch.cuda.is_available()}")


# numpy (by pytorch)
import numpy as np
print(f"numpy version = {np.version.version}")


# ultralytics
# import ultralytics
# print(f"ultralytics version = {ultralytics.__version__}")


# matplotlib (by ultralytics)
import matplotlib
print(f"matplotlib version = {matplotlib.__version__}")


# pyyaml 改用 ruamel.yaml
# import yaml
# print(f"pyyaml version = {yaml.__version__}")

# ruamel.yaml
from ruamel.yaml import YAML
print(f"ruamel.yaml version = {YAML.version}")


# onnx
import onnx
print(f"onnx version = {onnx.__version__}")


# onnxruntime-gpu
import onnxruntime as ort
print(f"onnxruntime version = {ort.__version__}")


# onnxslim
import onnxslim
print(f"onnxslim version = {onnxslim.__version__}")


# tensorrt （.whl 文件在 tensorrt 安装目录下的 python 目录下）
# uv pip install tensorrt-8.6.1-cp311-none-win_amd64.whl
import tensorrt
print(f"tensorrt version = {tensorrt.__version__}")


# jupyter
import jupyter_core
print(f"jupyter version = {jupyter_core.version.__version__}")